{extend name='admin@main'}

{block name="button"}
{if auth("store/express/add")}
<button data-modal='{:url("add")}' data-title="添加快递" class='layui-btn layui-btn-sm layui-btn-primary'>添加快递</button>
{/if}
{if auth("store/express/del")}
<button data-action='{:url("del")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除快递</button>
{/if}
{/block}

{block name="content"}
<table class="layui-table" lay-skin="line">
    <caption class="margin-bottom-10 text-left">{include file='express/index_search'}</caption>
    <!--{notempty name='list'}-->
    <thead>
    <tr>
        <th class='list-table-check-td think-checkbox'>
            <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
        </th>
        <th class='list-table-sort-td'>
            <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
        </th>
        <th class='text-left nowrap'>快递名称</th>
        <th class='text-left nowrap'>快递编码</th>
        <th class="text-center">记录状态</th>
        <th class="text-center">创建时间</th>
        <th></th>
    </tr>
    </thead>
    <!--{/notempty}-->
    <tbody>
    <!--{foreach $list as $key=>$vo}-->
    <tr data-dbclick>
        <td class='list-table-check-td think-checkbox'>
            <input class="list-check-box" value='{$vo.id}' type='checkbox'>
        </td>
        <td class='list-table-sort-td'>
            <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
        </td>
        <td class='text-left nowrap'>{$vo.express_title|default=''}</td>
        <td class='text-left nowrap'>{$vo.express_code|default=''}</td>
        <td class='text-center nowrap'>
            {eq name='vo.status' value='0'}<span class="layui-badge">已禁用</span>{else}<span class="layui-badge layui-bg-green">使用中</span>{/eq}<br>
        </td>
        <td class='text-center nowrap'>{$vo.create_at|format_datetime}</td>
        <td class='text-left nowrap'>

            {if auth("store/express/edit")}
            <a data-dbclick data-title="编辑快递" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
            {/if}

            {if $vo.status eq 1 and auth("store/express/forbid")}
            <a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
            {elseif auth("store/express/resume")}
            <a class="layui-btn layui-btn-xs layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
            {/if}

            {if auth("store/express/del")}
            <a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('del')}" data-value="id#{$vo.id}">删 除</a>
            {/if}

        </td>
    </tr>
    <!--{/foreach}-->
    </tbody>
</table>

{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

{/block}